package com.woniuxy.provider;

import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.jdbc.SQL;
import org.mockito.internal.matchers.And;

import com.woniuxy.pojo.FindRoom;
import com.woniuxy.pojo.RoomType;

public class RoomTypeProvider {
	//多条件查询房间类型
	public String manyfindRoomTypes(RoomType roomType){
		System.out.println("进入查询了");
		SQL sql=new SQL();
		sql.SELECT("*").FROM("roomtype");
		if (roomType.getRtid()!=0) {
			sql.WHERE("rtid="+roomType.getRtid());
		}
		if(roomType.getRwindow()!=null&&!(roomType.getRwindow().equals("无"))){
			sql.WHERE("rwindow='"+roomType.getRwindow()+"'");
		}
		if(roomType.getRfood()!=null&&!(roomType.getRfood().equals("无"))){
			sql.WHERE("rfood='"+roomType.getRfood()+"'");
		}
		if(roomType.getRspring()!=null&&!(roomType.getRspring().equals("无"))){
			sql.WHERE("rspring='"+roomType.getRspring()+"'");
			
		}
		System.out.println(sql.toString());
		return sql.toString();
		
	}
}
